package com.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Set;

/**
    * 权限表
    */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "t_permission")
public class Permission {
    @TableId(value = "id", type = IdType.INPUT)
    private Integer id;

    @TableField(value = "`name`")
    private String name;

    @TableField(value = "code")
    private String code;

    @TableField(value = "url")
    private String url;

    @TableField(value = "`type`")
    private String type;

    @TableField(value = "parent_id")
    private Integer parentId;

    @TableField(value = "order_no")
    private Integer orderNo;

    /**
     * 菜单图标
     */
    @TableField(value = "icon")
    private String icon;

    /**
     * 菜单对应要渲染的Vue组件名称
     */
    @TableField(value = "component")
    private String component;
    @TableField(exist = false) // 标识该字段不是数据库字段，不需要隐射到数据库
    private Set<Permission> childMenuPermissionList;
}